package cn.com.xinjinfu.pdoulcProduct.adapter;

import android.content.Context;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;

import cn.com.xinjinfu.pdoulcProduct.R;
import cn.com.xinjinfu.pdoulcProduct.manager.L;

/**
 * 通用 fragment viewpager adapter
 */
public class FragmentViewPagerAdapter extends FragmentPagerAdapter {

    /**Fragment list*/
    private List<Fragment> mList;

    /**
     * constructor
     * @param fm FragmentManager
     * @param context context
     */
    public FragmentViewPagerAdapter(FragmentManager fm, Context context, List<Fragment> list) {
        super(fm);
        this.mList = list;
    }

    @Override
    public Fragment getItem(int i) {
        return mList.get(i);
    }

    @Override
    public int getCount() {
        return mList == null ? 0 : mList.size();
    }

}
